package Test;

import static org.junit.Assert.*;

import org.junit.*;
import customer.Credit;

public class CreditTest{
	@Test
	public void testCreate_credit() {
		Credit c = new Credit();
		assertTrue(c.create_credit() == 0);
	}
	
	@Test
	public void testConnect_db() {
		Credit c = new Credit();
		assertTrue(c.connect_db() == 0);
		assertFalse(c.connect_db() == 1);
	}
	
	@Test
	public void testMoney_check() {
		Credit c = new Credit();
		assertTrue(c.money_check("50000") == 0);
		assertTrue(c.money_check("1000001") == 1);
		assertFalse(c.money_check("15000000") == 0);
		assertTrue(c.money_check("0") == 1);
		assertTrue(c.money_check("-50000") ==  1);
		assertTrue(c.money_check("") ==  1);
	}

}
